package com.bx.implatform.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.bx.implatform.entity.PrivateMessage;
import com.bx.implatform.vo.PrivateMessageVO;
import org.apache.ibatis.annotations.Select;


public interface PrivateMessageMapper extends BaseMapper<PrivateMessage> {

    /**
     * 查询指定性别的用户私信列表
     * @return
     */
    @Select("SELECT m.* FROM im_private_message m WHERE m.send_id <> #{userId} and m.recv_id = 0 ORDER BY m.id DESC limit 1")
    PrivateMessageVO selectMessageBySenderSex(Long userId);

}
